package cn.kai.ums.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 
 * @TableName ums_student
 */
@TableName(value ="ums_student")
@Data
public class UmsStudent implements Serializable {
    /**
     * 学生id自增长用于增删改
     */
    @TableId(type = IdType.AUTO)
    private Integer studentId;

    /**
     * 学生学号，由所在班级编号（8位）+数字（2位）组成
     */
    private String studentNo;

    /**
     * 学生姓名
     */
    private String studentName;

    /**
     * 所在班级编号
     */
    private String studentClassNo;

    /**
     * 学生性别
     */
    private String studentSex;

    /**
     * 学生出生日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date studentBirthday;

    /**
     * 学生家庭地址
     */
    private String studentAddress;

    @TableField(exist = false)
    private List<UmsClass> umsClassList;



    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UmsStudent other = (UmsStudent) that;
        return (this.getStudentId() == null ? other.getStudentId() == null : this.getStudentId().equals(other.getStudentId()))
            && (this.getStudentNo() == null ? other.getStudentNo() == null : this.getStudentNo().equals(other.getStudentNo()))
            && (this.getStudentName() == null ? other.getStudentName() == null : this.getStudentName().equals(other.getStudentName()))
            && (this.getStudentClassNo() == null ? other.getStudentClassNo() == null : this.getStudentClassNo().equals(other.getStudentClassNo()))
            && (this.getStudentSex() == null ? other.getStudentSex() == null : this.getStudentSex().equals(other.getStudentSex()))
            && (this.getStudentBirthday() == null ? other.getStudentBirthday() == null : this.getStudentBirthday().equals(other.getStudentBirthday()))
            && (this.getStudentAddress() == null ? other.getStudentAddress() == null : this.getStudentAddress().equals(other.getStudentAddress()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStudentId() == null) ? 0 : getStudentId().hashCode());
        result = prime * result + ((getStudentNo() == null) ? 0 : getStudentNo().hashCode());
        result = prime * result + ((getStudentName() == null) ? 0 : getStudentName().hashCode());
        result = prime * result + ((getStudentClassNo() == null) ? 0 : getStudentClassNo().hashCode());
        result = prime * result + ((getStudentSex() == null) ? 0 : getStudentSex().hashCode());
        result = prime * result + ((getStudentBirthday() == null) ? 0 : getStudentBirthday().hashCode());
        result = prime * result + ((getStudentAddress() == null) ? 0 : getStudentAddress().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", studentId=").append(studentId);
        sb.append(", studentNo=").append(studentNo);
        sb.append(", studentName=").append(studentName);
        sb.append(", studentClassNo=").append(studentClassNo);
        sb.append(", studentSex=").append(studentSex);
        sb.append(", studentBirthday=").append(studentBirthday);
        sb.append(", studentAddress=").append(studentAddress);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}